package fm.dongman.animefm.view.activity

import android.os.Bundle
import fm.dongman.animefm.R
import fm.dongman.animefm.view.fragment.BaseFragment
import fm.dongman.animefm.view.fragment.WebVideoFragment

/**
 * 网络视频播放界面
 * Created by shize on 2017/10/31.
 */
class WebVideoActivity : BaseActivity() {
    companion object {
        val BUNDLE_KEY = "fm.dongman.animefm.webVideo.bundle.key" // 设置播放地址的 key
    }

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_single)
        startFragment(WebVideoFragment.newInstance(intent.getStringExtra(BUNDLE_KEY)))
    }

    /**
     * 设置 Fragment
     */
    fun startFragment(fragment: BaseFragment) {
        val transaction = fragmentManager.beginTransaction()
        transaction.add(R.id.mSingleContent, fragment)
        transaction.commit()
    }
}